package com.springboot.demo.mapper;

import com.springboot.demo.entity.ReaderFine;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 相关信息：逾期项中的ReaderName,bookId,bookName,startTime,endTime,overdue(days),fine
 * @author wyh
 */
public interface ReaderFineMapper {

    /**
     * 通过电话查询罚金信息
     * @param phone
     * @return
     */
    @Select("SELECT phone, rname, ID, bname, start_time, end_time, days, fine FROM returntable NATURAL JOIN reader NATURAL JOIN book WHERE phone = #{phone} AND ID = #{bookid} AND start_time = #{starttime} AND overdue = 'yes'")
    List<ReaderFine> getReaderFine(String phone, long bookid, String starttime);
}
